<?php $this->load->view('common/admin_header');?>
<div class="block">
  <div class="block_head">
    <div class="bheadl"></div>
    <div class="bheadr"></div>
    <h2>客戶咨詢</h2>
  </div>
  <!-- .block_head ends -->
  <div class="block_content">
    <p class="breadcrumb">目前位置 &raquo; <a href="<?=site_url('admins/index')?>">控制台</a> &raquo; <strong>通知</strong></p>
    <?php $this->load->view('common/notify');?>
    <form action="<?=site_url('admins/feedbacks')?>" method="get">
      <input type="hidden" name="field" value="<?=isset($field)?$field:'add_time'?>" id="field">
      <input type="hidden" name="sort" value="<?=isset($sort)?$sort:'desc'?>" id="sort">
      <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
        <thead>
          <tr>
            <th><input type="checkbox" name="chk_all" id="chk_all"></th>
            <th><a id="id" class="<?=isset($field) && $field=='id'?$sort:'';?>" href="#"><?=lang('cart_number')?></a></th>
            <th><a id="name" class="<?=isset($field) && $field=='name'?$sort:'';?>" href="#">名稱</a></th>
            <th><a id="phone" class="<?=isset($field) && $field=='phone'?$sort:'';?>" href="#">電話</a></th>
            <th><a id="email" class="<?=isset($field) && $field=='email'?$sort:'';?>" href="#">電郵</a></th>
            <th><a id="add_time" class="<?=isset($field) && $field=='add_time'?$sort:'';?>" href="#">新增日期</a></th>
            <th><a id="is_view" class="<?=isset($field) && $field=='is_view'?$sort:'';?>" href="#">狀態</a></th>
            <th style="text-align:center">動作</th>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td><input type="text" class="stext" name="name" lang="zh-TW" x-webkit-speech x-webkit-grammar="bUIltin:search" value="<?=isset($name)?$name:''?>"></td>
            <td><input type="text" class="stext" name="phone" lang="zh-TW" x-webkit-speech x-webkit-grammar="bUIltin:search" value="<?=isset($phone)?$phone:''?>"></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td><select name="is_view">
                <option value="">選擇狀態</option>
                <option value="1" <?=isset($is_view) && $is_view==1?'selected':''?> >未查看</option>
                <option value="2" <?=isset($is_view) && $is_view==2?'selected':''?> >已查看</option>
              </select></td>
            <td style="text-align:center"><input type="submit" class="btn btn-small btn-primary" name="sub_filter" value="篩 選"/></td>
          </tr>
        </thead>
        <tbody class="table">
          <?php if(isset($lists_count) && $lists_count>0):?>
          <?php foreach($lists->result_array() as $list):
            $urls=site_url('admins/feedbacks/%s/'.$list['id']);
            $status=$list['is_view']==2?'已查看':'未查看';
         ?>
          <tr>
            <td><input type="checkbox" class="chk_one"  value="<?=$list['id']?>"></td>
            <td class="a-center"><?=$list['id']?></td>
            <td title="<?=$list['name']?>"><?=mb_substr($list['name'],0,7,'utf-8')?>
              <?php if(mb_strlen($list['name'])>7) echo '...';?></td>
            <td><?=$list['phone']?></td>
            <td><?=$list['email']?></td>
            <td><?=date($format_time,$list['add_time'])?></td>
            <td><?=$status?></td>
            <td class="listaction">
              <a href="<?=sprintf($urls,"views")?>" class="DetailsDOMWindow l_browse">詳情</a>
              <a href="javascript:void(0);" onClick="delete_item('<?=sprintf($urls,"delete")?>');" class="l_delete">刪除</a>
            </td>
          </tr>
          <?php endforeach;?>
          <?php else:?>
          <tr>
            <td colspan="9" class="nodata"><p>沒有任何資料！</p></td>
          </tr>
          <?php endif;?>
        </tbody>
      </table>
      <p>
        <input type="button" class="btn btn-small" onclick="delete_allitem('<?=site_url('admins/feedbacks/delete_batch')?>')" value="批量刪除"/>
      </p>
      <!-- .tableactions ends -->
      <div id="pagination"><?php echo $pagination;?><div class="listscount">共有 <?=$lists_count?> 條記錄</div></div>
      <!-- .pagination ends -->
    </form>
  </div>
  <!-- .block_content ends -->
  <div class="bendl"></div>
  <div class="bendr"></div>
</div>
<!-- .block ends -->
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
  $('.DetailsDOMWindow').openDOMWindow({
    eventType:'click',  
    width:550,
    height:550,
    loaderImagePath:"<?=base_url('themes/admins/img/loading.gif')?>", 
    windowSource:'ajax', 
    windowHTTPType:'post' 
  });
})
</script>
<?php $this->load->view('common/admin_footer');?>
